# 重要函数

# 1.range
# 2.len
# 3.range..len
# 对付列表,元组,和集合遍历
#
# 4.zip
# 方便的生成字典
#
# 5.enumerate
# 对付列表,元组,和集合遍历

# range
# 基础用法
for i in range(5):
    print(i);

# len
myList = [1, 3, 5, 7, 9];
myList = (1, 3, 5, 7, 9);
myList = {1, 3, 5, 7, 9};
myList = 'linux';
print(len(myList));

# range..len
for i in range(len(myList)):
    print(i, myList[i]);

# zip
myList1 = ['username1', 'username2'];
myList2 = ['user1', 'user2'];
# myList3 = list(zip(myList1, myList2));
# myList3 = tuple(zip(myList1, myList2));
# myList3 = set(zip(myList1, myList2));
myList3 = dict(zip(myList1, myList2));
print(myList3);

# enumerate
myList = [1, 3, 5, 7, 9];
for key,val in enumerate(myList):
    print(key, val);
